package com.ysccc.shares.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Index;
import javax.persistence.Table;

import com.ysccc.shares.enums.Market;
import com.ysccc.spring.boot.starter.sqldb.entity.DefaultStategyEntity;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 股票信息
 * 
 * @author GaoFeng
 *
 * @date 2019年3月29日
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "shares", indexes = @Index(columnList = "market, code", name = "i_shares", unique = true))
public class Shares extends DefaultStategyEntity {

	private static final long serialVersionUID = 1L;

	/** 股票代码 */
	@Column(length = 16)
	private String code;
	
	/** 股票上市市场 */
	@Enumerated(EnumType.STRING)
	@Column(length = 4)
	private Market market;

	/** 股票名称 */
	private String name;

	/** 历史最高 */
	private Double maxPrice;

	/** 卖出价 */
	private Double salePrice;
	
	/** 购买日期 */
	private Date buyTime;
}
